#pragma once

#include <cppunit/extensions/HelperMacros.h>

#include "Optimizer.h"

class OptimizerTest : public CPPUNIT_NS::TestFixture 
{ 

	CPPUNIT_TEST_SUITE( OptimizerTest ); 
	CPPUNIT_TEST( testConstructor ); 
	CPPUNIT_TEST( testSplitIndependentClauses ); 
	CPPUNIT_TEST( testExtractSynonymlessClauses ); 
	CPPUNIT_TEST( testIsAnyClauseLeft ); 
	CPPUNIT_TEST_SUITE_END();

public:
	void setUp();
	void tearDown();

	Clause createClause(int type, 
						const std::string& patternSynonym, PatternType patternType,
						bool perfectMatch1, bool perfectMatch2, bool perfectMatch3,
						RelationshipType relType, ConstraintType conType,
						ConstraintAttrType conAttrType1, ConstraintAttrType conAttrType2,
						const std::string& arg1, RelationshipArgumentType argType1,
						const std::string& arg2, RelationshipArgumentType argType2,
						const std::string& arg3, RelationshipArgumentType argType3);
	Clause createRelationshipClause(RelationshipType relType, 
									const std::string &arg1, RelationshipArgumentType argType1, 
									const std::string &arg2, RelationshipArgumentType argType2);
	Clause createPatternClause(PatternType pType, const std::string &synonym, RelationshipArgumentType synType, 
									const std::string &arg1, RelationshipArgumentType argType1, bool perfectMatch1,
									const std::string &arg2, RelationshipArgumentType argType2, bool perfectMatch2,
									const std::string &arg3, RelationshipArgumentType argType3, bool perfectMatch3);
	Clause createConstraintClause(ConstraintType conType, 
									const std::string &arg1, RelationshipArgumentType argType1, ConstraintAttrType conAttrType1, 
									const std::string &arg2, RelationshipArgumentType argType2, ConstraintAttrType conAttrType2);

	// Tests the constructor
	void testConstructor();
	// Tests the splitIndependentClauses() static function
	void testSplitIndependentClauses();
	// Tests the extractSynonymlessClauses() static function
	void testExtractSynonymlessClauses();
	// Tests the isAnyClauseLeft() function
	void testIsAnyClauseLeft();
};